﻿package mortal.game.view.lookPlayerInfo.view
{
    import Message.DB.Tables.*;
    import Message.Public.*;
    import baseEngine.modifiers.*;
    import com.mui.utils.*;
    import frEngine.effectEditTool.temple.*;
    import frEngine.pools.*;
    import mortal.component.window.*;
    import mortal.game.resource.tableConfig.*;
    import mortal.game.scene3D.model.data.*;
    import mortal.game.scene3D.model.player.*;
    import mortal.game.scene3D.model.pools.*;

    public class LookFightSoulPanel extends LookSystemBasePanel
    {

        public function LookFightSoulPanel(param1:Window)
        {
            super(param1);
            return;
        }// end function

        override protected function update3DModel() : void
        {
            var _loc_1:TModel = null;
            var _loc_2:String = null;
            var _loc_3:String = null;
            if (_rect3d && _tmountInfo)
            {
                _loc_1 = ModelConfig.instance.getInfoByCode(_tmountInfo.modelId);
                _loc_2 = _loc_1.mesh1 + ".md5mesh";
                _loc_3 = _loc_1.bone1 + ".skeleton";
                if (_bodyPlayer == null)
                {
                    _bodyPlayer = FrObjectPool.getObject(ActionPlayer, this);
                }
                if (_bodyPlayer.meshUrl != _loc_2 || _bodyPlayer.animUrl != _loc_3)
                {
                    _bodyPlayer.load(_loc_2, _loc_3, _loc_1.texture1, _rect3d.renderList);
                }
                _bodyPlayer.changeAction(ActionName.MountStand);
                _bodyPlayer.alpha = 1;
                _bodyPlayer.play();
                this.reset3dModelPos(_loc_1);
                if (_effectPlayer)
                {
                    _effectPlayer.dispose(true);
                    _effectPlayer = null;
                }
                if (_loc_1.effect1)
                {
                    _effectPlayer = EffectPlayerPool.instance.getEffectPlayer(_loc_1.effect1, _bodyPlayer, _rect3d.renderList, false);
                    if (_effectPlayer.temple is TempleRole)
                    {
                        (_effectPlayer.temple as TempleRole).setRoleParams(_bodyPlayer, null, null);
                    }
                    _effectPlayer.play(PlayMode.ANIMATION_LOOP_MODE);
                }
            }
            return;
        }// end function

        override protected function reset3dModelPos(param1:TModel = null) : void
        {
            var _loc_2:* = _slookPlayerMountInfo.state >= 0;
            _bodyPlayer.rotationY = 0;
            if (_loc_2)
            {
                _bodyPlayer.material.materialParams.coloredScreen = false;
            }
            else
            {
                _bodyPlayer.material.materialParams.coloredScreen = true;
            }
            if (_lookType == ELookUpType._ELookUpTypeFightSoul)
            {
                _bodyPlayer.scaleValue = 10;
                _rect3d.addObject3d(_bodyPlayer, 132 + 20 + 90, 280 + 60 + 20);
            }
            else if (_lookType == ELookUpType._ELookUpTypeFightMethod)
            {
                _bodyPlayer.scaleValue = 1;
                _rect3d.addObject3d(_bodyPlayer, 132 + 20 + 90, 280 + 60 + 20 - 35);
            }
            else if (_lookType == ELookUpType._ELookUpTypeDragonSoul)
            {
                _bodyPlayer.scaleValue = 2.2;
                _rect3d.addObject3d(_bodyPlayer, 132 + 20 + 90, 280 + 60 + 20 - 35 + 50);
            }
            else if (_lookType == ELookUpType._ELookUpTypeHolyBook)
            {
                _bodyPlayer.scaleValue = 1;
                _rect3d.addObject3d(_bodyPlayer, 132 + 20 + 90, 280 + 60 + 20);
            }
            else if (_lookType == ELookUpType._ELookUpTypeWarShield)
            {
                _bodyPlayer.scaleValue = 2.2;
                _rect3d.addObject3d(_bodyPlayer, 132 + 20 + 90, 280 + 60 + 20 - 145);
            }
            else if (_lookType == ELookUpType._ELookUpTypeMonsterSoul)
            {
                _bodyPlayer.scaleValue = 1;
                _rect3d.addObject3d(_bodyPlayer, 132 + 20 + 90, 280 + 60 + 20);
            }
            return;
        }// end function

        override protected function addOtherObj() : void
        {
            return;
        }// end function

        override protected function updateVip() : void
        {
            return;
        }// end function

        override protected function getVipToolTip() : String
        {
            return "";
        }// end function

        override protected function addEquipMendtPart() : void
        {
            _equipMentPart = UICompomentPool.getUICompoment(LookFightSoulEquipPanel);
            _equipMentPart.x = 20;
            _equipMentPart.y = 195;
            _equipMentPart.alpha = 1;
            _window.contentTopOf3DSprite.addChild(_equipMentPart);
            return;
        }// end function

    }
}
